package edu.sctu.alex.projectPratice.test20150628;


import edu.sctu.zhuyingzhi.month201505.day20150504.interfacePra.Intelligence;

/**
 * Created by alex on 2015/6/28.
 */
public class GoodsMethods {

    public void judgePrice(KeyOfJson keyOfJson){
        int countOne = 0; //价格大于100

        int countTwo = 0; //价格小于100

        for (int i = 0; i <keyOfJson.list.size() ; i++) {

            Float price=  Float.parseFloat(keyOfJson.list.get(i).goods_price);

            if(price >=100){
                countOne++;

            }else if(price>0 && price<100){
                countTwo++;

            }
        }

        System.out.println("价格大于100的商品有"+countOne+"个");
        System.out.println("价格小于100的商品有"+countTwo+"个");

    }
}

